//index.js
import ajax from "../../utils/ajax";
import api from "../../utils/api";
Page({
  data: {
    advSwiperList: [1,2,3],
    hotSaleList: [0,1,2,3,4,5],
    activityList: [0,1,2,3],
    recommendList: [0,1,2,3,4,5,6,7,8,9]
  },
  
  onLoad: function () {
    wx.setNavigationBarTitle({
      title: '首页',
    })

    this.getHomeList();
  },
  
  // 获取首页所有列表
  getHomeList() {
    let that = this;
    // ajax.ajax(api.HomeList, {})
    //   .then((val) => {
    //     console.log(val)
    //     if (val.Tag == 1 && val.Result) {
    //       that.setData({
    //         advSwiperList: val.Result.,
    //         hotSaleList: val.Result.,
    //         activityList: val.Result.,
    //         recommendList: val.Result.,
    //       })
    //     } else {
    //       wx.showToast({title: "加载失败，请重试", icon: 'none'})
    //     }
    //   })
    //   .catch((val) => {
    //     wx.showToast({title: "加载失败，请重试", icon: 'none'})
    //   })
  }
})
